<script>
import BestProfitList from 'components/greatman/BestProfitList'
import GameExcellentList from 'components/greatman/GameExcellentList'
import LivelyList from 'components/greatman/LivelyList'
import PopularList from 'components/greatman/PopularList'

export default {
  name: 'list',
  functional: true,
  render (createElement, context) {
    const index = context.props.index

    function appropriateMomentComponent () {
      return [
                LivelyList,
                BestProfitList,
                PopularList,
                GameExcellentList
              ][index]
    }
    return createElement(
      appropriateMomentComponent(),
      context.data,
      context.children
    )
  },
  props: {
    index: String
  }
}
</script>
